package com.bj58.data.emailreports.utils;

import com.bj58.groupbuy.util.PathUtil;
import com.bj58.info.bi.service.BiService;
import com.bj58.poster.service.JobReceiveService;
import com.bj58.poster.service.ThisScfLookupUrl;
import com.bj58.spat.scf.client.proxy.builder.ProxyFactory;
import com.bj58.dsap.api.scf.contract.IHbaseApi;

public class ScfUtil {

	/**获得使用摊销接口
	 * @return
	 */
	public static BiService getBiService() {
		String url = "tcp://biservice/BiService";
		return ProxyFactory.create(BiService.class, url);
	}
	
	public static JobReceiveService getJobReceiveService() {
		String url = ThisScfLookupUrl.SmsService.getUrl();
		return ProxyFactory.create(JobReceiveService.class, url);
	}
	
	public static IHbaseApi getHbaseService() {
		String url = "tcp://dsapapi/HBaseApi";
		return ProxyFactory.create(IHbaseApi.class, url);
	}
	
	
	public static void initSCF() {
		String CONFIG_ROOT_PATH=PathUtil.getWFNamespaceFolder();
		String configPath = CONFIG_ROOT_PATH + "/scf.config";
		System.out.println("configPath:"+configPath);
		System.setProperty("scf.config.path", configPath);
		System.setProperty("scf.jar.path", CONFIG_ROOT_PATH);
	}
	
}
